#ifndef WEEKLY_SCHED_H
#define WEEKLY_SCHED_H

#include "Appointment.h"
#include "DailySchedule.h"
#include <iomanip>

using namespace std;


class WeeklySchedule 
{

public:
	WeeklySchedule();
	~WeeklySchedule();

	static int ENTRY_WIDTH;

	virtual void printSchedule () const;
	
	bool setAnAppointment(Time const & start, Time const & end, int day,string const & subject = "N/A") throw (string);
	
	Appointment* removeAnAppointment(Time const & start, int day);
	
	Appointment* findAppointment(Time const & start, int day) const;
	
	bool moveAppointment(Time const & startOrig, int dayOrig, 
						 Time const & startNew = dummyTime, Time const & endNew = dummyTime, int dayNew = -1,string const & newSubject = "N/A") throw (string);

protected:
	bool WeeklySchedule::setAnAppointment(Appointment* app);
	static const Time dummyTime;

private:
	DailySchedule* schedules[7];

	set<Appointment*,fnCompareAppointment>::iterator const * 
		getMinDayIterator(set<Appointment*,fnCompareAppointment>::iterator const * arr) const;
};

ostream& allign(ostream& os);


#endif